#ifndef __PATH_CACHE__
#define __PATH_CACHE__

#include <stdint.h>
#include "object.h"

/* 
  Implements a path cache for saving expensive lookup, and 
  to avoid contention of top level directory

  The logical structure of the path cache is 

  ---------------------------------------
  | 64_bit FH | Object_ID (FILE or DIR) |
  ---------------------------------------

  Operations available are
  - Insert a new Object_ID and get a file handle        [Open]
  - Lookup by file_handle                               [Read/write]
  - Delete the mapping                                  [Close]

*/

void init_path_cache ();

uint64_t add_mapping (object_id *id);

void resolve_mapping (uint64_t fh, object_id *id);

void remove_mapping (uint64_t fh);

#endif /* PATH_CACHE */
